<template>
	<view class="warp">
		<view class="title">
			请完善一下信息
		</view>
		<view class="form">
			<view class="item">
				<view class="item.name">
					客户姓名
				</view>
				<view class="item_value">
					<input  v-model="form.customerName" type="text" placeholder="客户姓名">
				</view>
			</view>
			<view class="item">
				<view class="item.name">
					手机号码
				</view>
				<view class="item_value">
					<input v-model="form.phoneNum" type="text" placeholder="手机号码">
				</view>
			</view>
			<view class="item">
				<view class="item.name">
					所属企业
				</view>
				<view class="item_value">
					<input v-model="form.company" type="text" placeholder="所属企业">
				</view>
			</view>
			<view class="item">
				<view class="item.name">
					职位名称
				</view>
				<view class="item_value">
					<input v-model="form.jobTitle" type="text" placeholder="职位名称">
				</view>
			</view>
			<view class="item">
				<view class="item.name">
					微信号
				</view>
				<view class="item_value">
					<input v-model="form.wechatIdwechatId" type="text" placeholder="微信号">
				</view>
			</view>
			<view class="item">
				<view class="item.name">
					微信昵称
				</view>
				<view class="item_value">
					<input v-model="form.wechatName" type="text" placeholder="微信昵称">
				</view>
			</view>
			<view class="item">
				<view class="item.name">
					性别
				</view>
				<view class="item_value">
					<input v-model="form.sex" type="text" placeholder="性别">
				</view>
			</view>
			<view class="item">
				<view class="item.name">
					邮箱
				</view>
				<view class="item_value">
					<input v-model="form.email" type="text" placeholder="邮箱">
				</view>
			</view>
			<view class="item">
				<view class="item.name">
					生日
				</view>
				<view class="item_value">
					<input v-model="form.birthday" type="text" placeholder="生日">
				</view>
			</view>
			<view class="item">
				<view class="item.name">
					地址信息
				</view>
				<view class="item_value">
					<input v-model="form.address" type="text" placeholder="地址信息">
				</view>
			</view>
			<view class="item">
				<view class="item.name">
					客户描述
				</view>
				<view class="item_value">
					<textarea v-model="form.customerDescription" type="text" placeholder="客户描述"></textarea>
				</view>
			</view>
		</view>
		<view class="" style="padding-bottom: 25%;">
			
		</view>
		<view class="bootom_btn" >
			<view class="btn" @click="submitbtn">
				提交
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form:{
					
				}
			};
		},
		onLoad(e) {
			this.getcustomerinfo(e)
			
		},
		methods:{
			// 获取客户信息
			getcustomerinfo(val){
				this.$request({
					url:'v3/customer/front/appCustomer/'+val.id,
					method:"GET",
					
				}).then(res=>{
						this.form=res.data
						this.form.createTime=null
						this.form.updateTime=null
				})
				 
			},
			submitbtn(){
				this.$request({
					url:'v3/customer/front/appCustomer',
					method:'PUT',
					header:{
					  'Content-Type': 'application/json'
					},
					data:this.form
				}).then(res=>{
					uni.navigateBack({delta:1})
				})
				 
			}
			
			
			
		}
	}
</script>

<style lang="scss" scoped>
	page{
		width: 750rpx;
		margin: 0 auto;
		background: #F5F5F5;
	}
.warp{
	background-color: #f7f7f7;
	color: #282828;
	font-family: PingFang-SC-Regular;
	.title{
		margin-top: 20rpx;
		font-size: 26rpx;
		padding: 20rpx 30rpx;
	}
	.form{
		padding: 30rpx;
		margin-top: 20rpx;
		background-color: #fff;
		.item{
			display: flex;
			justify-content: space-between;
			font-size: 28rpx;
			padding: 15rpx 0;
		}
	}
	.bootom_btn{
		width: 100%;
		height: 120rpx;
		background-color: red;
		position: fixed;
		bottom: 0;
		background-color: #fff;
		padding: 30rpx 20%;
		.btn{
			width: 100%;
			height: 60rpx;
			background-color:#fd4953;
			color: #fff;
			text-align: center;
			line-height: 60rpx;
			border-radius: 30rpx;
		}
	}
}
</style>
